package com.cqcomponents.components;

import org.apache.commons.lang.StringUtils;

import com.cqcomponents.annotations.JcrPropertyInjection;

public class Contentreference extends BaseComponent {

	private String referencedPath;
	private String referencedResourceType;

	@Override
	public boolean getHasContent() {
		return StringUtils.isNotBlank(referencedPath)
				&& StringUtils.isNotBlank(referencedResourceType);
	}

	@JcrPropertyInjection
	public void setReferencedPath(String referencedPath) {
		this.referencedPath = referencedPath;
	}

	public String getReferencedPath() {
		return this.referencedPath;
	}

	@Override
	public String toString() {
		return "ContentReference={path:" + referencedPath + ",type:"
				+ referencedResourceType + "}";
	}

	public void setReferencedResourceType(String referencedResourceType) {
		this.referencedResourceType = referencedResourceType;
	}

	public String getReferencedResourceType() {
		return this.referencedResourceType;
	}
}
